package com.ws.shop.bean;

import java.io.File;
import java.lang.reflect.Field;

import com.ws.shop.util.StringUtil;

public class FileDir {

	public String uploadSave;//上传文件保存目录
	public String tmp;
	public String biddir;
	public String head;
	
	public String getHead() {
		return head;
	}

	public void setHead(String head) {
		this.head = head;
	}

	public String getTmp() {
		return tmp;
	}

	public void setTmp(String tmp) {
		this.tmp = tmp;
	}

	public String getBiddir() {
		return biddir;
	}

	public void setBiddir(String biddir) {
		this.biddir = biddir;
	}

	public String getUploadSave() {
		return uploadSave;
	}

	public void setUploadSave(String uploadSave) {
		this.uploadSave = uploadSave;
	}

	public void init() throws IllegalArgumentException, IllegalAccessException{
		Field[] fields = FileDir.class.getDeclaredFields();
		for(Field f : fields){
			String value = (String)f.get(this);
			if(StringUtil.isEmpty(value))
				continue;
			File file = new File(value);
			if(!file.exists())
				file.mkdirs();
		}
	}
}
